package cn.tedu.restaurant.config;

import cn.tedu.restaurant.interceptor.LoginInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;


@Configuration
public class LoginConfig implements WebMvcConfigurer {

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        // 注册Interceptor拦截器
        registry.addInterceptor(new LoginInterceptor()).addPathPatterns("/**")
            .excludePathPatterns( 
                "/register.html",
                "/login.html",
                "/index.html",
                "/top/count",
                "/foodlist.html",
                "/culture.html",
                "/foodcontent.html",
                "/groupbuy-content.html",
                "/groupbuy-list.html",
                "/groupbuy-index.html",
                "/jifenguize.html",
                "/shoplist.html",
                "/scorecontent.html",
                "/jifenguize.html",
                "/jifenlieb.html",
                "/jifenhuodong.html",
                "/js/**",
                "/dishes/list",
                "/dishes/**",
                "/FortAwesome/**",
                "/user/reg", "/user/login", "/**/*.js", 
                "/**/*.css", 
                "/images/**", "/**/*.woff", "/**/*.ttf");

//        WebMvcConfigurer.super.addInterceptors(registry);
    }

}
